
// 迭代器
let gen = function* () {
    yield 1
    // 迭代数组中的每个元素 迭代完才会继续4 
    yield* [2, 3];
    yield 4;
}
let it4 = gen();
console.log(it4.next());// 1
console.log(it4.next());// 2
console.log(it4.next());// 3
console.log(it4.next());// 4
console.log(it4.next());// undfined

